<?php
@require("php_config_init.php");
@require("php_config_mysql.php");
$goods_type = $_GET["goods_type"];
//sql语句
$sql = "select c.goods_id,c.goods_name,c.goods_sket,c.goods_price,c.goods_sweet,c.goods_smallimg,c.goods_img1,c.goods_img2,c.goods_img3,c.goods_details,c.measure_id,mi.measure,mi.size,mi.num,mi.mount,mi.img from goods_info c,$goods_type n,measureinfo mi where c.status = 1 and n.status = 1 and mi.status = 1 and c.id = n.goodsid and c.measure_id = mi.id";
//执行sql语句
$result = mysql_query($sql);
$list = array();
//解析一行数据，没有返回false
while($item = mysql_fetch_array($result)){
    $temp = array();
    $temp["goods_id"] = $item["goods_id"];
    $temp["goods_name"] = $item["goods_name"];
    $temp["goods_sket"] = $item["goods_sket"];
    $temp["goods_price"] = $item["goods_price"];
    $temp["goods_sweet"] = $item["goods_sweet"];
    $temp["goods_smallimg"] = $item["goods_smallimg"];
    $temp["goods_img1"] = $item["goods_img1"];
    $temp["goods_img2"] = $item["goods_img2"];
    $temp["goods_img3"] = $item["goods_img3"];
    $temp["goods_details"] = $item["goods_details"];
    $temp["measure"] = $item["measure"];
    $temp["size"] = $item["size"];
    $temp["num"] = $item["num"];
    $temp["mount"] = $item["mount"];
    $temp["img"] = $item["img"];
    $temp["measure_id"] = $item["measure_id"];
    $list[] = $temp;
}
echo json_encode($list);
?>